/*
 * marketsim-eclipsetrader
 *
 * Copyright (C) 2008-2011 Steve Phelps and John Cartlidge
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */
package victria.marketsim.core;

public class Spread {

	protected float bidPrice = 0;
	
	protected float askPrice = 0;
	
	protected int bidQuantity = 0;
	
	protected int askQuantity = 0;

	public Spread(float bid, float ask, int bidQuantity, int askQuantity) {
		super();
		this.bidPrice = bid;
		this.askPrice = ask;
		this.bidQuantity = bidQuantity;
		this.askQuantity = askQuantity;
	}

	public Spread() {
		super();
	}
	
	public float getMidPrice() {
		return (bidPrice + askPrice) / 2;
	}
	
	public int getMidQuantity() {
		return (bidQuantity + askQuantity) / 2;
	}
	
	public float getAskPrice() {
		return askPrice;
	}

	public void setAskPrice(float ask) {
		this.askPrice = ask;
	}

	public float getBidPrice() {
		return bidPrice;
	}

	public void setBidPrice(float bid) {
		this.bidPrice = bid;
	}

	public int getAskQuantity() {
		return askQuantity;
	}

	public void setAskQuantity(int askQuantity) {
		this.askQuantity = askQuantity;
	}

	public int getBidQuantity() {
		return bidQuantity;
	}

	public void setBidQuantity(int bidQuantity) {
		this.bidQuantity = bidQuantity;
	}
	
	
}
